Carbon


GetControlData

Header: Controls.h Carbon status: Supported

Obtains control-specific data.

OSErr GetControlData (
    ControlRef inControl, 
    ControlPartCode inPart, 
    ResType inTagName, 
    Size inBufferSize, 
    void *inBuffer, 
    Size *outActualSize
);
inControl

A handle to the control to be examined.

inPart

The part code of the control part from which data is to be obtained; see “Meta Control Part Code Constants”, “Control Part Code Constants”, and “Control State Part Code Constants”. Passing kControlEntireControl indicates that either the control has no parts or the data is not tied to any specific part of the control.

inTagName

A constant representing the control-specific data you wish to obtain; see the data tag constants in the “Control Manager Constants” section.

inBufferSize

The size (in bytes) of the data pointed to by the inBuffer parameter. For variable-length control data, pass the value returned in the outMaxSize parameter of GetControlDataSize in the inBufferSize parameter. The number of bytes must match the actual data size.

inBuffer

On input, a pointer to a buffer allocated by your application. On return, the buffer contains a copy of the control-specific data. If you pass NULL on input, it is equivalent to calling GetControlDataSize. The actual size of the control-specific data will be returned in the outActualSize parameter. For variable-length data, the number of bytes must match the actual data size.

outActualSize

On input, a pointer to a Size value. On return, the value is set to the actual size of the data.

function result

A result code. The result code errDataNotSupported indicates that the inTagName parameter is not valid.

DISCUSSION

The GetControlData function will only copy the amount of data specified in the inBufferSize parameter, but will tell you the actual size of the buffer so you will know if the data was truncated.

VERSION NOTES

This function is available with Appearance Manager 1.0 and later.

AVAILABILITY

Supported in Carbon. Available in Mac OS 8.1 and later when Carbon 1.0.2 or later is present.


© 2000 Apple Computer, Inc. — (Last Updated 5/8/2000)